home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / MoviesFormat.p < prev    next >
Text File  |  1996-05-01  |  15KB  |  545 lines

  1. {
  2.      File:        MoviesFormat.p
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 2.1
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT MoviesFormat;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __MOVIESFORMAT__}
  28. {$SETC __MOVIESFORMAT__ := 1}
  29.  
  30. {$I+}
  31. {$SETC MoviesFormatIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __WINDOWS__}
  38. {$I Windows.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  41. {$I ImageCompression.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __MOVIES__}
  44. {$I Movies.p}
  45. {$ENDC}
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  52.  
  53. CONST
  54.     kMovieVersion                = 0;                            {  version number of the format here described  }
  55.  
  56. {
  57. ***************************************
  58. *
  59. *   General Types -
  60. *        These types are used in more than one of the
  61. *        directory types.
  62. *
  63. ***************************************
  64. }
  65. {  MoviesUserData is the type used for user data in movie and track directories  }
  66.  
  67. TYPE
  68.     MoviesUserDataPtr = ^MoviesUserData;
  69.     MoviesUserData = RECORD
  70.         size:                    LONGINT;                                {  size of this user data  }
  71.         udType:                    LONGINT;                                {  type of user data  }
  72.         data:                    SInt8;                                    {  the user data  }
  73.     END;
  74.  
  75.     UserDataAtomPtr = ^UserDataAtom;
  76.     UserDataAtom = RECORD
  77.         size:                    LONGINT;
  78.         atomType:                LONGINT;
  79.         userData:                ARRAY [0..0] OF MoviesUserData;
  80.     END;
  81.  
  82. {
  83. ***************************************
  84. *
  85. *   MediaDirectory information -
  86. *        The MediaDirectory is tightly coupled to the data.
  87. *
  88. ***************************************
  89. }
  90.     SampleDescriptionAtomPtr = ^SampleDescriptionAtom;
  91.     SampleDescriptionAtom = RECORD
  92.         size:                    LONGINT;
  93.         atomType:                LONGINT;                                {  = 'stsd'  }
  94.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  95.         numEntries:                LONGINT;
  96.         sampleDescTable:        ARRAY [0..0] OF SampleDescription;
  97.     END;
  98.  
  99. {  TimeToSampleNum maps physical sample time to physical sample number.  }
  100.     TimeToSampleNumPtr = ^TimeToSampleNum;
  101.     TimeToSampleNum = RECORD
  102.         sampleCount:            LONGINT;
  103.         sampleDuration:            TimeValue;
  104.     END;
  105.  
  106.     TimeToSampleNumAtomPtr = ^TimeToSampleNumAtom;
  107.     TimeToSampleNumAtom = RECORD
  108.         size:                    LONGINT;
  109.         atomType:                LONGINT;                                {  = 'stts'  }
  110.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  111.         numEntries:                LONGINT;
  112.         timeToSampleNumTable:    ARRAY [0..0] OF TimeToSampleNum;
  113.     END;
  114.  
  115. {  SyncSamples is a list of the physical samples which are self contained.  }
  116.     SyncSampleAtomPtr = ^SyncSampleAtom;
  117.     SyncSampleAtom = RECORD
  118.         size:                    LONGINT;
  119.         atomType:                LONGINT;                                {  = 'stss'  }
  120.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  121.         numEntries:                LONGINT;
  122.         syncSampleTable:        ARRAY [0..0] OF LONGINT;
  123.     END;
  124.  
  125. {  SampleToChunk maps physical sample number to chunk number.  }
  126. {  same as SampleToChunk, but redundant first sample is removed  }
  127.     SampleToChunkPtr = ^SampleToChunk;
  128.     SampleToChunk = RECORD
  129.         firstChunk:                LONGINT;
  130.         samplesPerChunk:        LONGINT;
  131.         sampleDescriptionID:    LONGINT;
  132.     END;
  133.  
  134.     SampleToChunkAtomPtr = ^SampleToChunkAtom;
  135.     SampleToChunkAtom = RECORD
  136.         size:                    LONGINT;
  137.         atomType:                LONGINT;                                {  = 'stsc'  }
  138.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  139.         numEntries:                LONGINT;
  140.         sampleToChunkTable:        ARRAY [0..0] OF SampleToChunk;
  141.     END;
  142.  
  143.     ChunkOffsetAtomPtr = ^ChunkOffsetAtom;
  144.     ChunkOffsetAtom = RECORD
  145.         size:                    LONGINT;
  146.         atomType:                LONGINT;                                {  = 'stco'  }
  147.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  148.         numEntries:                LONGINT;
  149.         chunkOffsetTable:        ARRAY [0..0] OF LONGINT;
  150.     END;
  151.  
  152.     SampleSizeAtomPtr = ^SampleSizeAtom;
  153.     SampleSizeAtom = RECORD
  154.         size:                    LONGINT;
  155.         atomType:                LONGINT;                                {  = 'stsz'  }
  156.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  157.         sampleSize:                LONGINT;
  158.         numEntries:                LONGINT;
  159.         sampleSizeTable:        ARRAY [0..0] OF LONGINT;
  160.     END;
  161.  
  162.     ShadowSyncPtr = ^ShadowSync;
  163.     ShadowSync = RECORD
  164.         fdSampleNum:            LONGINT;
  165.         syncSampleNum:            LONGINT;
  166.     END;
  167.  
  168.     ShadowSyncAtomPtr = ^ShadowSyncAtom;
  169.     ShadowSyncAtom = RECORD
  170.         size:                    LONGINT;
  171.         atomType:                LONGINT;                                {  = 'stsz'  }
  172.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  173.         numEntries:                LONGINT;
  174.         shadowSyncTable:        ARRAY [0..0] OF ShadowSync;
  175.     END;
  176.  
  177.     SampleTableAtomPtr = ^SampleTableAtom;
  178.     SampleTableAtom = RECORD
  179.         size:                    LONGINT;
  180.         atomType:                LONGINT;                                {  = 'stbl'  }
  181.         sampleDescription:        SampleDescriptionAtom;
  182.         timeToSampleNum:        TimeToSampleNumAtom;
  183.         sampleToChunk:            SampleToChunkAtom;
  184.         syncSample:                SyncSampleAtom;
  185.         sampleSize:                SampleSizeAtom;
  186.         chunkOffset:            ChunkOffsetAtom;
  187.         shadowSync:                ShadowSyncAtom;
  188.     END;
  189.  
  190.     PublicHandlerInfoPtr = ^PublicHandlerInfo;
  191.     PublicHandlerInfo = RECORD
  192.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  193.         componentType:            LONGINT;
  194.         componentSubType:        LONGINT;
  195.         componentManufacturer:    LONGINT;
  196.         componentFlags:            LONGINT;
  197.         componentFlagsMask:        LONGINT;
  198.         componentName:            SInt8;
  199.     END;
  200.  
  201.     HandlerAtomPtr = ^HandlerAtom;
  202.     HandlerAtom = RECORD
  203.         size:                    LONGINT;
  204.         atomType:                LONGINT;                                {  = 'hdlr'  }
  205.         hInfo:                    PublicHandlerInfo;
  206.     END;
  207.  
  208. {  a data reference is a private structure  }
  209.     DataRefAtom                            = LONGINT;
  210.     DataInfoAtomPtr = ^DataInfoAtom;
  211.     DataInfoAtom = RECORD
  212.         size:                    LONGINT;
  213.         atomType:                LONGINT;                                {  = 'dinf'  }
  214.         dataRef:                DataRefAtom;
  215.     END;
  216.  
  217.     RgnAtomPtr = ^RgnAtom;
  218.     RgnAtom = RECORD
  219.         size:                    LONGINT;
  220.         atomType:                LONGINT;
  221.         rgnSize:                INTEGER;
  222.         rgnBBox:                Rect;
  223.         data:                    SInt8;
  224.     END;
  225.  
  226.     MatteCompressedAtomPtr = ^MatteCompressedAtom;
  227.     MatteCompressedAtom = RECORD
  228.         size:                    LONGINT;
  229.         atomType:                LONGINT;
  230.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  231.         matteImageDescription:    ImageDescription;
  232.         matteData:                SInt8;
  233.     END;
  234.  
  235.     MatteAtomPtr = ^MatteAtom;
  236.     MatteAtom = RECORD
  237.         size:                    LONGINT;
  238.         atomType:                LONGINT;
  239.         aCompressedMatte:        MatteCompressedAtom;
  240.     END;
  241.  
  242.     ClippingAtomPtr = ^ClippingAtom;
  243.     ClippingAtom = RECORD
  244.         size:                    LONGINT;
  245.         atomType:                LONGINT;
  246.         aRgnClip:                RgnAtom;
  247.     END;
  248.  
  249. {
  250. **********************
  251. * Media Info Example Structures
  252. **********************
  253. }
  254.     VideoMediaInfoHeaderPtr = ^VideoMediaInfoHeader;
  255.     VideoMediaInfoHeader = RECORD
  256.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  257.         graphicsMode:            INTEGER;                                {  for QD - transfer mode  }
  258.         opColorRed:                INTEGER;                                {  opcolor for transfer mode  }
  259.         opColorGreen:            INTEGER;
  260.         opColorBlue:            INTEGER;
  261.     END;
  262.  
  263.     VideoMediaInfoHeaderAtomPtr = ^VideoMediaInfoHeaderAtom;
  264.     VideoMediaInfoHeaderAtom = RECORD
  265.         size:                    LONGINT;                                {  size of Media info  }
  266.         atomType:                LONGINT;                                {  = 'vmhd'  }
  267.         vmiHeader:                VideoMediaInfoHeader;
  268.     END;
  269.  
  270.     VideoMediaInfoPtr = ^VideoMediaInfo;
  271.     VideoMediaInfo = RECORD
  272.         size:                    LONGINT;                                {  size of Media info  }
  273.         atomType:                LONGINT;                                {  = 'minf'  }
  274.         header:                    VideoMediaInfoHeaderAtom;
  275.         dataHandler:            HandlerAtom;
  276.         dataInfo:                DataInfoAtom;
  277.         sampleTable:            SampleTableAtom;
  278.     END;
  279.  
  280.     SoundMediaInfoHeaderPtr = ^SoundMediaInfoHeader;
  281.     SoundMediaInfoHeader = RECORD
  282.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  283.         balance:                INTEGER;
  284.         rsrvd:                    INTEGER;
  285.     END;
  286.  
  287.     SoundMediaInfoHeaderAtomPtr = ^SoundMediaInfoHeaderAtom;
  288.     SoundMediaInfoHeaderAtom = RECORD
  289.         size:                    LONGINT;                                {  size of Media info  }
  290.         atomType:                LONGINT;                                {  = 'vmhd'  }
  291.         smiHeader:                SoundMediaInfoHeader;
  292.     END;
  293.  
  294.     SoundMediaInfoPtr = ^SoundMediaInfo;
  295.     SoundMediaInfo = RECORD
  296.         size:                    LONGINT;                                {  size of Media info  }
  297.         atomType:                LONGINT;                                {  = 'minf'  }
  298.         header:                    SoundMediaInfoHeaderAtom;
  299.         dataHandler:            HandlerAtom;
  300.         dataReference:            DataRefAtom;
  301.         sampleTable:            SampleTableAtom;
  302.     END;
  303.  
  304. {  whatever data the media handler needs goes after the atomType  }
  305.     MediaInfoPtr = ^MediaInfo;
  306.     MediaInfo = RECORD
  307.         size:                    LONGINT;
  308.         atomType:                LONGINT;
  309.     END;
  310.  
  311. {
  312. **********************
  313. * Media Directory Structures
  314. **********************
  315. }
  316.     MediaHeaderPtr = ^MediaHeader;
  317.     MediaHeader = RECORD
  318.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  319.         creationTime:            LONGINT;                                {  seconds since Jan 1904 when directory was created  }
  320.         modificationTime:        LONGINT;                                {  seconds since Jan 1904 when directory was appended  }
  321.         timeScale:                TimeValue;                                {  start time for Media (Media time)  }
  322.         duration:                TimeValue;                                {  length of Media (Media time)  }
  323.         language:                INTEGER;
  324.         quality:                INTEGER;
  325.     END;
  326.  
  327.     MediaHeaderAtomPtr = ^MediaHeaderAtom;
  328.     MediaHeaderAtom = RECORD
  329.         size:                    LONGINT;
  330.         atomType:                LONGINT;
  331.         header:                    MediaHeader;
  332.     END;
  333.  
  334.     MediaDirectoryPtr = ^MediaDirectory;
  335.     MediaDirectory = RECORD
  336.         size:                    LONGINT;
  337.         atomType:                LONGINT;                                {  = 'mdia'  }
  338.         mediaHeader:            MediaHeaderAtom;                        {  standard Media information  }
  339.         mediaHandler:            HandlerAtom;
  340.         mediaInfo:                MediaInfo;
  341.     END;
  342.  
  343. {
  344. **********************
  345. * Track Structures
  346. **********************
  347. }
  348.  
  349. CONST
  350.     TrackEnable                    = $01;
  351.     TrackInMovie                = $02;
  352.     TrackInPreview                = $04;
  353.     TrackInPoster                = $08;
  354.  
  355.  
  356. TYPE
  357.     TrackHeaderPtr = ^TrackHeader;
  358.     TrackHeader = RECORD
  359.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  360.         creationTime:            LONGINT;                                {  seconds since Jan 1904 when directory was created  }
  361.         modificationTime:        LONGINT;                                {  seconds since Jan 1904 when directory was appended  }
  362.         trackID:                LONGINT;
  363.         reserved1:                LONGINT;
  364.         duration:                TimeValue;                                {  length of track (track time)  }
  365.         reserved2:                LONGINT;
  366.         reserved3:                LONGINT;
  367.         layer:                    INTEGER;
  368.         alternateGroup:            INTEGER;
  369.         volume:                    INTEGER;
  370.         reserved4:                INTEGER;
  371.         matrix:                    MatrixRecord;
  372.         trackWidth:                Fixed;
  373.         trackHeight:            Fixed;
  374.     END;
  375.  
  376.     TrackHeaderAtomPtr = ^TrackHeaderAtom;
  377.     TrackHeaderAtom = RECORD
  378.         size:                    LONGINT;                                {  size of track header  }
  379.         atomType:                LONGINT;                                {  = 'tkhd'  }
  380.         header:                    TrackHeader;
  381.     END;
  382.  
  383.     EditListTypePtr = ^EditListType;
  384.     EditListType = RECORD
  385.         trackDuration:            TimeValue;
  386.         mediaTime:                TimeValue;
  387.         mediaRate:                Fixed;
  388.     END;
  389.  
  390.     EditListAtomPtr = ^EditListAtom;
  391.     EditListAtom = RECORD
  392.         size:                    LONGINT;
  393.         atomType:                LONGINT;                                {  = elst  }
  394.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  395.         numEntries:                LONGINT;
  396.         editListTable:            ARRAY [0..0] OF EditListType;
  397.     END;
  398.  
  399.     EditsAtomPtr = ^EditsAtom;
  400.     EditsAtom = RECORD
  401.         size:                    LONGINT;
  402.         atomType:                LONGINT;                                {  = edts  }
  403.         editList:                EditListAtom;
  404.     END;
  405.  
  406.     TrackLoadSettingsPtr = ^TrackLoadSettings;
  407.     TrackLoadSettings = RECORD
  408.         preloadStartTime:        TimeValue;
  409.         preloadDuration:        TimeValue;
  410.         preloadFlags:            LONGINT;
  411.         defaultHints:            LONGINT;
  412.     END;
  413.  
  414.     TrackLoadSettingsAtomPtr = ^TrackLoadSettingsAtom;
  415.     TrackLoadSettingsAtom = RECORD
  416.         size:                    LONGINT;
  417.         atomType:                LONGINT;                                {  = load  }
  418.         settings:                TrackLoadSettings;
  419.     END;
  420.  
  421.     TrackDirectoryPtr = ^TrackDirectory;
  422.     TrackDirectory = RECORD
  423.         size:                    LONGINT;
  424.         atomType:                LONGINT;                                {  = 'trak'  }
  425.         trackHeader:            TrackHeaderAtom;                        {  standard track information  }
  426.         trackClip:                ClippingAtom;
  427.         edits:                    EditsAtom;
  428.         media:                    MediaDirectory;
  429.         userData:                UserDataAtom;                            {  space for extending with new data types  }
  430.     END;
  431.  
  432. {
  433. ***************************************
  434. *
  435. *   MovieDirectory -
  436. *        The MovieDirectory is the top level structure which
  437. *        holds the TrackInstance describing where the
  438. *        TrackDirectories are.
  439. *
  440. ***************************************
  441. }
  442.     MovieHeaderPtr = ^MovieHeader;
  443.     MovieHeader = RECORD
  444.         flags:                    LONGINT;                                {  1 byte of version / 3 bytes of flags  }
  445.         creationTime:            LONGINT;                                {  seconds since Jan 1904 when directory was created  }
  446.         modificationTime:        LONGINT;                                {  seconds since Jan 1904 when directory was appended  }
  447.         timeScale:                TimeValue;                                {  Time specifications  }
  448.         duration:                TimeValue;
  449.         preferredRate:            Fixed;                                    {  rate at which to play this movie  }
  450.         preferredVolume:        INTEGER;                                {  volume to play movie at  }
  451.         reserved1:                INTEGER;
  452.         preferredLong1:            LONGINT;
  453.         preferredLong2:            LONGINT;
  454.         matrix:                    MatrixRecord;
  455.         previewTime:            TimeValue;                                {  time in track the proxy begins (track time)  }
  456.         previewDuration:        TimeValue;                                {  how long the proxy lasts (track time)  }
  457.         posterTime:                TimeValue;                                {  time in track the proxy begins (track time)  }
  458.         selectionTime:            TimeValue;                                {  time in track the proxy begins (track time)  }
  459.         selectionDuration:        TimeValue;                                {  time in track the proxy begins (track time)  }
  460.         currentTime:            TimeValue;                                {  time in track the proxy begins (track time)  }
  461.         nextTrackID:            LONGINT;                                {  next value to use for a TrackID  }
  462.     END;
  463.  
  464.     MovieHeaderAtomPtr = ^MovieHeaderAtom;
  465.     MovieHeaderAtom = RECORD
  466.         size:                    LONGINT;
  467.         atomType:                LONGINT;                                {  = 'mvhd'  }
  468.         header:                    MovieHeader;
  469.     END;
  470.  
  471.     MovieDirectoryPtr = ^MovieDirectory;
  472.     MovieDirectory = RECORD
  473.         size:                    LONGINT;
  474.         atomType:                LONGINT;                                {  = 'moov'  }
  475.         header:                    MovieHeaderAtom;
  476.         movieClip:                ClippingAtom;
  477.                                                                         {  Track Directories  }
  478.         track:                    ARRAY [0..0] OF TrackDirectory;
  479.                                                                         {  User data for Movie  }
  480.         userData:                UserDataAtom;                            {  space for user extensions  }
  481.     END;
  482.  
  483. {
  484. ***************************************
  485. ***************************************
  486. }
  487. {  Movie formats and tags  }
  488.  
  489. CONST
  490.                                                                 {  some system defined format IDs  }
  491.     MOVIE_TYPE                    = 'moov';
  492.     TRACK_TYPE                    = 'trak';
  493.     MEDIA_TYPE                    = 'mdia';
  494.     VIDEO_TYPE                    = 'vide';
  495.     SOUND_TYPE                    = 'soun';
  496.  
  497. {  atom id's  }
  498.     MovieAID                    = 'moov';
  499.     MovieHeaderAID                = 'mvhd';
  500.     ClipAID                        = 'clip';
  501.     RgnClipAID                    = 'crgn';
  502.     MatteAID                    = 'matt';
  503.     MatteCompAID                = 'kmat';
  504.     TrackAID                    = 'trak';
  505.     UserDataAID                    = 'udta';
  506.     TrackHeaderAID                = 'tkhd';
  507.     EditsAID                    = 'edts';
  508.     EditListAID                    = 'elst';
  509.     MediaAID                    = 'mdia';
  510.     MediaHeaderAID                = 'mdhd';
  511.     MediaInfoAID                = 'minf';
  512.     VideoMediaInfoHeaderAID        = 'vmhd';
  513.     SoundMediaInfoHeaderAID        = 'smhd';
  514.     GenericMediaInfoHeaderAID    = 'gmhd';
  515.     GenericMediaInfoAID            = 'gmin';
  516.     DataInfoAID                    = 'dinf';
  517.     DataRefAID                    = 'dref';
  518.     SampleTableAID                = 'stbl';
  519.     STSampleDescAID                = 'stsd';
  520.     STTimeToSampAID                = 'stts';
  521.     STSyncSampleAID                = 'stss';
  522.     STSampleToChunkAID            = 'stsc';
  523.     STShadowSyncAID                = 'stsh';
  524.     HandlerAID                    = 'hdlr';
  525.     STSampleSizeAID                = 'stsz';
  526.     STChunkOffsetAID            = 'stco';
  527.     DataRefContainerAID            = 'drfc';
  528.     TrackReferenceAID            = 'tref';
  529.     ColorTableAID                = 'ctab';
  530.     LoadSettingsAID                = 'load';
  531.     PropertyAtomAID                = 'code';
  532.     InputMapAID                    = 'imap';
  533.  
  534. {$ENDC}
  535. {$ALIGN RESET}
  536. {$POP}
  537.  
  538. {$SETC UsingIncludes := MoviesFormatIncludes}
  539.  
  540. {$ENDC} {__MOVIESFORMAT__}
  541.  
  542. {$IFC NOT UsingIncludes}
  543.  END.
  544. {$ENDC}
  545.